This patch add localtime to dumpcore filename.
authorroot@procyon <root@procyon>
Thu, 14 Sep 2006 07:19:39 +0000 (08:19 +0100)
committerroot@procyon <root@procyon>
Thu, 14 Sep 2006 07:19:39 +0000 (08:19 +0100)
And it add '-imcomplete' if failed.

Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
tools/python/xen/xend/XendDomainInfo.py

index e1e9207041df49df694d1e9c4b334dffd15a1db6..259aaab331d3179c4001f62942128e5c0ce1b9d6 100644 (file)
@@ -982,11 +982,14 @@ class XendDomainInfo:
         
         try:
             if not corefile:
-                corefile = "/var/xen/dump/%s.%s.core" % (self.info['name'],
-                                                     self.domid)
+                this_time = time.strftime("%Y-%m%d-%H%M.%S", time.localtime())
+                corefile = "/var/xen/dump/%s-%s.%s.core" % (this_time,
+                                  self.info['name'], self.domid)
             xc.domain_dumpcore(self.domid, corefile)
 
         except:
+            corefile_incomp = corefile+'-incomplete'
+            os.rename(corefile, corefile_incomp)
             log.exception("XendDomainInfo.dumpCore failed: id = %s name = %s",
                           self.domid, self.info['name'])